package Dao;

import D524.SqlConnection;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class UserDao {
    public int addUser(String username, String password) throws SQLException,ClassNotFoundException {
        Connection connection = SqlConnection.getCon();
        String sql = "insert into users(username,password) values(?,?)";
        PreparedStatement  preparedStatement = connection.prepareStatement(sql);
        preparedStatement.setString(1,username);
        preparedStatement.setString(2,password);
        return preparedStatement.executeUpdate();
    }

}
